<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Location_model extends CI_Model
{
	function __construct() 
	{
		parent::__construct();
	}

	function save($tbl, $data, $name='', $id=0)
	{
		if($name)
		{
			$this->db->where($name, $id) ;
			if($this->db->update($tbl, $data))
				return $id ;
			else return false;
		}
		else
		{
			if($this->db->insert($tbl,$data))
				return $this->db->insert_id();
			else return false;
		}
	}
}
?>
